package com.xyc.cloud.cloudeureka.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@Controller
public class CustomerController {

    @Resource
    private RestTemplate restTemplate;
    @ResponseBody
    @RequestMapping("get-msg")
    public String getMsg(){
        String forObject = restTemplate.getForObject("http://eureka-provider1/provider-msg", String.class);
        return forObject;
    }
}
